using UnityEngine;
using System.Collections;

public class SysDetectInput : MonoBehaviour
{
	public GameObject postionFlag;
	public GUIText guiShowTouchPosition;

	void Start()
	{
		Input.multiTouchEnabled = true;

//		Debug.Log( Camera.mainCamera.ScreenToWorldPoint( new Vector3( 0, 0, 1000 ) ) );
	}

	void Update()
	{
		Vector3 mousePosition = Input.mousePosition;
		mousePosition.z = -Camera.mainCamera.transform.position.z;

		guiShowTouchPosition.text = "Mouse Position: " + mousePosition.ToString() + "\n";

		Vector3 worldPosition = Camera.mainCamera.ScreenToWorldPoint( mousePosition );
		guiShowTouchPosition.text += "World Position: " + worldPosition.ToString();

		postionFlag.transform.position = new Vector3( worldPosition.x, worldPosition.y, postionFlag.transform.position.z );
	}
}
